package com.etooling.pdm.entity;


import com.etooling.framework.entity.Employee;
import com.etooling.framework.svo.AbstractEntity;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

/**
 * 产品分类
 */
@Data
@Entity
@Table(name = "t_goods_type", schema = "pdm")
public class GoodsType extends AbstractEntity {
    public static String STATUS_RUNNING = "启用";
    public static String STATUS_DISABLE = "禁用";
    public static String STATUS_IS_DEL = "删除";
    public static String STATUS_IS_YES = "是";
    public static String STATUS_IS_NO = "否";
    Employee creator;//创建人
    Date createTime;// 创建时间
    Employee modifier;//修改人
    Date lastModifiedTime; //最后修改时间

    String typeName;//分类名称
    String typeCode;//判断唯一，分类编码
    String parentId;//父级分类id
    Integer seq;//分类的显示顺序
    String status;//状态
    Boolean isProduct;//分类下的是否是成品
    Boolean isComponents;//分类下的是否是成品
    String typeNamePath;
    String typeCodePath;
    String companyId;


    @ManyToOne(targetEntity = Employee.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "creator_id")
    public Employee getCreator() {
        return creator;
    }

    @ManyToOne(targetEntity = Employee.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "modifier_id")
    public Employee getModifier() {
        return modifier;
    }

    // 下方的用不到
    @Deprecated
    @Transient
    String goodsIdPath;
    @Deprecated
    @Transient
    String erpTypeCode;
    @Deprecated
    @Transient
    String erpSubjectCode;
    @Deprecated
    @Transient
    String erpName;
    @Deprecated
    @Transient
    String goodsPath;
    @Deprecated
    @Transient
    String comByWeight;
    @Deprecated
    @Transient
    String GoodsPathOrderJson; //对应VO GoodsNameOrderVO//这个分类的排序属性名排序方式
    @Deprecated
    @Transient
    String isReuse;//是否复用件，如模具。用完后要做入库操作。
    @Transient
    List<GoodsType> children;//用于构建antd树

    @Transient
    public List<GoodsType> getChildren() {
        return children;
    }

    @Transient
    public void setChildren(List<GoodsType> children) {
        this.children = children;
    }

    @Transient
    public String getGoodsIdPath() {
        return goodsIdPath;
    }

    @Transient
    public void setGoodsIdPath(String goodsIdPath) {
        this.goodsIdPath = goodsIdPath;
    }

    @Transient
    public String getErpTypeCode() {
        return erpTypeCode;
    }

    @Transient
    public void setErpTypeCode(String erpTypeCode) {
        this.erpTypeCode = erpTypeCode;
    }

    @Transient
    public String getErpSubjectCode() {
        return erpSubjectCode;
    }

    @Transient
    public void setErpSubjectCode(String erpSubjectCode) {
        this.erpSubjectCode = erpSubjectCode;
    }

    @Transient
    public String getErpName() {
        return erpName;
    }

    @Transient
    public void setErpName(String erpName) {
        this.erpName = erpName;
    }

    @Transient
    public String getGoodsPath() {
        return goodsPath;
    }

    @Transient
    public void setGoodsPath(String goodsPath) {
        this.goodsPath = goodsPath;
    }

    @Transient
    public String getComByWeight() {
        return comByWeight;
    }

    @Transient
    public void setComByWeight(String comByWeight) {
        this.comByWeight = comByWeight;
    }

    @Transient
    public String getGoodsPathOrderJson() {
        return GoodsPathOrderJson;
    }

    @Transient
    public void setGoodsPathOrderJson(String goodsPathOrderJson) {
        GoodsPathOrderJson = goodsPathOrderJson;
    }

    @Transient
    public String getIsReuse() {
        return isReuse;
    }

    @Transient
    public void setIsReuse(String isReuse) {
        this.isReuse = isReuse;
    }
}
